Event.observe ( window, 'load', bootstrap );

function bootstrap () {
  var update_tag_select = function () {
    var specification = $( 'specification' ).value;
    
    update_specification_tags ( specification, 'old_tag' );
    update_specification_tags ( specification, 'new_tag' );
  };
  
  var update_submit = function () {
    enable_or_disable ( 'submit', $( 'old_tag' ).value !== '-' && $( 'new_tag' ).value !== '-' );
  };
  
  $( 'specification' ).onchange = function () { update_tag_select () };
  $( 'old_tag'       ).onchange = function () { update_submit     () };
  $( 'new_tag'       ).onchange = function () { update_submit     () };
}
